package o;

import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ToggleButton;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView.s;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import o.dky.h;
import o.dky.i;

public class ciu extends androidx.recyclerview.widget.RecyclerView.a<a> {
    private int ˊ;
    private ArrayList<dgp> ˋ = new ArrayList();
    private cis ˎ;

    static class a extends s {
        private WeakReference<ciu> ॱᐝ;
        private final ToggleButton ᐝॱ;

        a(View view, ciu o_ciu) {
            super(view);
            this.ॱᐝ = new WeakReference(o_ciu);
            this.ᐝॱ = (ToggleButton) view.findViewById(h.ॱᐨ);
            this.ᐝॱ.setOnClickListener(new OnClickListener(this) {
                final /* synthetic */ a ˊ;

                {
                    this.ˊ = r1;
                }

                public void onClick(View view) {
                    ciu o_ciu = (ciu) this.ˊ.ॱᐝ.get();
                    if (o_ciu != null) {
                        o_ciu.ʼ(this.ˊ.ˋ());
                    }
                }
            });
        }

        ToggleButton ˉ() {
            return this.ᐝॱ;
        }
    }

    public /* synthetic */ void ˋ(@NonNull s sVar, int i, @NonNull List list) {
        ˊ((a) sVar, i, list);
    }

    public /* synthetic */ s ˎ(ViewGroup viewGroup, int i) {
        return ˏ(viewGroup, i);
    }

    public /* synthetic */ void ॱ(s sVar, int i) {
        ˊ((a) sVar, i);
    }

    public void ˎ(cis o_cis) {
        this.ˎ = o_cis;
    }

    public int ॱ() {
        return this.ˊ;
    }

    public void ʽ(int i) {
        if (i < 0 || i > this.ˋ.size() - 1) {
            this.ˊ = 0;
        } else {
            this.ˊ = i;
        }
    }

    public void ˋ(ArrayList<dgp> arrayList) {
        if (arrayList == null) {
            arrayList = new ArrayList();
        }
        this.ˋ = arrayList;
    }

    private void ʼ(int i) {
        int i2 = this.ˊ;
        this.ˊ = i;
        if (i2 != i) {
            ˊ(i2);
            if (this.ˎ != null) {
                this.ˎ.ʼ(i);
                this.ˎ.ʽ(i2);
            }
        } else if (this.ˎ != null) {
            this.ˎ.ॱॱ(i);
        }
        ˊ(i);
    }

    public a ˏ(ViewGroup viewGroup, int i) {
        return new a(LayoutInflater.from(viewGroup.getContext()).inflate(i.ᐝॱ, viewGroup, false), this);
    }

    public void ˊ(a aVar, int i) {
        CharSequence ˊ = ((dgp) this.ˋ.get(i)).ˊ();
        aVar.ˉ().setTextOn(ˊ);
        aVar.ˉ().setTextOff(ˊ);
        aVar.ˉ().setText(ˊ);
        aVar.ˉ().setChecked(i == this.ˊ);
    }

    public void ˊ(@NonNull a aVar, int i, @NonNull List<Object> list) {
        super.ˋ(aVar, i, list);
    }

    public int ˏ() {
        return this.ˋ.size();
    }
}
